
***************************************
* Chapter 2 
***************************************


* Univariate analysis of citizen data
******************************************


*open data
******************************************

use "wvs7.dta", clear

svyset

* Number of respondents per country
tab country


gen no=1
set scheme plotplain

gen agecat7 = Q262
recode agecat7 17/20 21 22 23 24 25 26 27 28 29=1 30 31 32 33 34 35 36 37 38 39=2 40 41 42 43 44 45 46 47 48 49=3 50 51 52 53 54 55 56 57 58 59=4 60 61 62 63 64 65 66 67 68 69=5 70 71 72 73 74 75 76 77 78 79=6 80 81 82 83 84 85 86 87/103=7

tab agecat7

*figure 2.1

#delimit ;
graph bar (percent) no [pweight=S018], 
over(agecat7, sort(descending) relabel(1 "<29" 2 "30s" 3 "40s" 4 "50s" 5 "60s" 6 "70s" 7 ">80")) by(country)
 ytitle("") ylab(0 "0%" 5 "5%" 10 "10%" 15 "15%" 20 "20%" 25 "25%" 30 "30%")
 legend(col(1) size(medsmall))
 saving(fig2_1.gph, replace) 
;
#delimit cr
 
*figure 2.2 

#delimit ;
graph bar (percent) no [pweight=S018], 
over(male, sort(descending) relabel(1 "Female" 2 "Male")) by(country)
 ytitle("") ylab(0 "0%" 20 "20%" 40 "40%" 60 "60%")
 legend(col(1) size(medsmall))
 saving(fig2_2.gph, replace) 
;
#delimit cr

*figure 2.3

tab edu
label drop Q275
#delimit ;
graph bar (percent) no [pweight=S018], 
over(edu, sort(descending)) by(country)
 ytitle("") ylab(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%")
 legend(col(1) size(medsmall))
 saving(fig2_3.gph, replace) 
;
#delimit cr
 

* Description knowledge questions in text

tab knUNSC_DK0 
tab knIMF_DK0 
tab knAMN_DK0 
tab knowledge_DK0

 
* figure 2.4

by country, sort: tab knowledge_DK0

#delimit ;
graph bar (percent) no [pweight=S018], 
over(knowledge_DK0, sort(descending)) by(country)
 ytitle("") ylab(0 "0%" 20 "20%" 40 "40%" 60 "60%")
 legend(col(1) size(medsmall))
 saving(fig2_4.gph, replace) 
;
#delimit cr
 

* Table 2.2
 
tab confios, missing
tab confICC, missing
tab confIMF, missing
tab confUN, missing
tab confWB, missing
tab confWHO, missing
tab confWTO, missing

sort country
by country: tab confios, missing
by country: tab confICC, missing
by country: tab confIMF, missing
by country: tab confUN, missing
by country: tab confWB, missing
by country: tab confWHO, missing
by country: tab confWTO, missing
 
 
* Univariate analysis of elite data
************************************


*open data
******************************************

use "Elites five countries all GGIs.dta", clear



*figure 2.5


sum age

sort country
by country: sum age

ttest age=51.2437 if country==276

gen agecat7 = age
recode agecat7 21 22 23 24 25 26 27 28 29=1 30 31 32 33 34 35 36 37 38 39=2 40 41 42 43 44 45 46 47 48 49=3 50 51 52 53 54 55 56 57 58 59=4 60 61 62 63 64 65 66 67 68 69=5 70 71 72 73 74 75 76 77 78 79=6 80 81 82 83 84 85 86 87=7

tab agecat7

#delimit ;
graph bar (percent) no , 
over(agecat7, sort(descending) relabel(1 "20s" 2 "30s" 3 "40s" 4 "50s" 5 "60s" 6 "70s" 7 "80s")) by(country)
 ytitle("") ylab(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%") 
 legend(col(1) size(medsmall)) saving(fig2_5.gph, replace) 
;
#delimit cr



*figure 2.6

tab male
recode male 0=1 1=0 //so that 1 == male
tab2 male country, col(2)

#delimit ;
graph bar (percent) no , 
over(male, sort(descending) relabel(1 "Female" 2 "Male"))  by(country)
 ytitle("") ylab(0 "0%" 20 "20%" 40 "40%" 60 "60%" 80 "80%") 
 legend(col(1) size(medsmall)) saving(fig2_6.gph, replace) 
 ;
#delimit cr


*figure 2.7

sum education 
sort country
by country: sum education

set scheme plotplain

#delimit ;
graph bar (percent) no , 
over(education, sort(descending)) by(country)
 ytitle("") ylab(0 "0%" 10 "10%" 20 "20%" 30 "30%" 40 "40%" 50 "50%" 60 "60%" 70 "70%")
 legend(col(1) size(medsmall)) saving(fig2_7.gph, replace) 
 ;
#delimit cr


*figure 2.8

tab knUNSC_DK0 
tab knIMF_DK0 
tab knAMN_DK0 
tab knowledge_DK0
tab know_all

#delimit ;
graph bar (percent) no , 
over(knowledge_DK0, sort(descending)) by(country)
 ytitle("") ylab(0 "0%" 20 "20%" 40 "40%" 60 "60%" 80 "80%")  
 legend(col(1) size(medsmall)) saving(fig2_8.gph, replace)
;
#delimit cr








* Table 2.4

tab confios, missing
tab confICC, missing
tab confIMF, missing
tab confUN, missing
tab confWB, missing
tab confWHO, missing
tab confWTO, missing

sort country
by country: tab confios, missing
by country: tab confICC, missing
by country: tab confIMF, missing
by country: tab confUN, missing
by country: tab confWB, missing
by country: tab confWHO, missing
by country: tab confWTO, missing

* Comparison with other GGIs in text

tab confFIFA, missing
tab confFSC, missing
tab confG20, missing
tab confKP, missing
tab confICANN, missing
tab confNATO, missing
tab confUNFCCC, missing
tab confUNSC, missing











 
 
